package com.leps.nq.bu.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.leps.nq.bu.entity.BuStation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leps.nq.bu.vo.StationQueryModel;
import com.leps.nq.bu.vo.StationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 区块表 Mapper 接口
 * </p>
 *
 * @author hex
 * @since 2022-05-22
 */
@Mapper
public interface BuStationMapper extends BaseMapper<BuStation> {

    List<BuStation> selectStationListByUserId(Long userId);

    int updateCustName(String newCustName, int custId);

    int updateAreaName(String areaName, int areaId);

    Page<StationVo> selectByQueryModel(Page<StationVo> page, @Param("queryModel") StationQueryModel queryModel);

    int updateRedundantField(BuStation station);

    List<Integer> selectStationIdListByAreaId(Collection<Integer> areaIds);

    List<BuStation> selectListByAreaIdAndUserId(@Param("areaId") Integer areaId, @Param("userId") long userId);
}
